﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MemberMgr.Website._Default" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>会员管理系统</title>
    <ext:ResourcePlaceHolder ID="ResourcePlaceHolder1" runat="server" Mode="Script" />
    <ext:ResourcePlaceHolder ID="ResourcePlaceHolder2" runat="server" Mode="Style" />
    <link rel="stylesheet" type="text/css" href="resources/css/main.css" />

    <script type="text/javascript" src="resources/js/main.js"></script>
    <script type="text/javascript">
        var userlogout = function() {
            Ext.Msg.confirm("注销", "确定注销此次登录吗?", function(buttonId) {
                if (buttonId == "yes") {
                    location.href = "Login.aspx";
                }
            });
        }
    </script>

</head>
<body>
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:History ID="History1" runat="server">
        <Listeners>
            <Change Fn="change" />
        </Listeners>
    </ext:History>
    <ext:Viewport runat="server" Layout="border">
        <Items>
            <ext:Panel runat="server" Header="false" Region="North" Border="false" Html="<div id='header' style='height:32px;'><a style='float:right;margin-right:10px;' href='#' target='_blank'><img style='margin-top: 4px;' height='20' width='102' src='resources/images/url3.gif'/></a><div class='api-title' style='font-family:微软雅黑'>乘风会员管理系统</div></div>" />
            <ext:Panel runat="server" Region="West" Layout="Fit" Width="240" Header="false" Collapsible="true"
                Split="true" CollapseMode="Mini" Margins="0 0 4 4" Border="false">
                <Items>
                    <ext:TreePanel ID="exampleTree" runat="server" Header="false" AutoScroll="true" Lines="false"
                        UseArrows="true" CollapseFirst="false" ContainerScroll="true" RootVisible="false">
                        <TopBar>
                            <ext:Toolbar ID="Toolbar1" runat="server">
                                <Items>
                                    <ext:Label ID="lblUserInfo" runat="server" Text="您好,">
                                    </ext:Label>
                                    <ext:Label ID="lblUserName" runat="server" Text="">
                                    </ext:Label>
                                    <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                                    <ext:Button ID="btnLogout" runat="server" Icon="ApplicationStop" ToolTip="注销">
                                        <Listeners>
                                            <Click Fn="userlogout" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="Button1" runat="server" Icon="Cog" ToolTip="Options">
                                        <Menu>
                                            <ext:Menu ID="Menu1" runat="server">
                                                <Items>
                                                    <ext:MenuItem ID="MenuItem5" runat="server" Text="修改密码" Icon="Lock">
                                                        <Listeners>
                                                            <Click Handler="#{PasswordField}.setValue('');#{PasswordFieldVal}.setValue('');#{winPassword}.show();" />
                                                        </Listeners>
                                                    </ext:MenuItem>
                                                    <ext:MenuItem ID="MenuItem1" runat="server" Text="全部展开" IconCls="icon-expand-all">
                                                        <Listeners>
                                                            <Click Handler="#{exampleTree}.root.expand(true);" />
                                                        </Listeners>
                                                    </ext:MenuItem>
                                                    <ext:MenuItem ID="MenuItem2" runat="server" Text="全部折叠" IconCls="icon-collapse-all">
                                                        <Listeners>
                                                            <Click Handler="#{exampleTree}.root.collapse(true);" />
                                                        </Listeners>
                                                    </ext:MenuItem>
                                                    <ext:MenuSeparator ID="MenuSeparator1" runat="server" />
                                                    <ext:MenuItem ID="MenuItem3" runat="server" Text="主题" Icon="Paintcan">
                                                        <Menu>
                                                            <ext:Menu ID="Menu2" runat="server">
                                                                <Items>
                                                                    <ext:CheckMenuItem ID="CheckMenuItem1" runat="server" Text="Default" Group="theme"
                                                                        Checked="true" />
                                                                    <ext:CheckMenuItem ID="CheckMenuItem2" runat="server" Text="Gray" Group="theme" />
                                                                    <ext:CheckMenuItem ID="MenuItem4" runat="server" Text="Slate" Group="theme" />
                                                                    <ext:CheckMenuItem ID="CheckMenuItem3" runat="server" Text="Access" Group="theme" />
                                                                </Items>
                                                                <Listeners>
                                                                    <ItemClick Handler="X.GetThemeUrl(menuItem.text,{
                                                                        success : function (result) {
                                                                            Ext.net.ResourceMgr.setTheme(result);
                                                                            ExampleTabs.items.each(function (el) {
                                                                                if (!Ext.isEmpty(el.iframe)) {
                                                                                    if (el.getBody().Ext) {
                                                                                        el.getBody().Ext.net.ResourceMgr.setTheme(result, menuItem.text.toLowerCase());
                                                                                    }
                                                                                }
                                                                            });
                                                                        }
                                                                    });" />
                                                                </Listeners>
                                                            </ext:Menu>
                                                        </Menu>
                                                    </ext:MenuItem>
                                                </Items>
                                            </ext:Menu>
                                        </Menu>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <%--<Root>
                            <ext:AsyncTreeNode Text="系统菜单" NodeID="root" Expanded="true">
                                <CustomAttributes>
                                    <ext:ConfigItem Name="loaded" Value="false" Mode="Raw" />
                                </CustomAttributes>
                            </ext:AsyncTreeNode>
                        </Root>
                        <Loader>
                            <ext:PageTreeLoader RequestMethod="GET" OnNodeLoad="GetExamplesNodes" PreloadChildren="true">
                                <EventMask ShowMask="true" Target="Parent" Msg="Loading..." />
                                <BaseAttributes>
                                    <ext:Parameter Name="singleClickExpand" Value="true" Mode="Raw" />
                                    <ext:Parameter Name="loaded" Value="true" Mode="Raw" />
                                </BaseAttributes>
                            </ext:PageTreeLoader>
                        </Loader>--%>
                        <Listeners>
                            <Click Handler="if (node.isLeaf()) { e.stopEvent(); loadExample(node.attributes.href, node.id, node.text); }" />
                        </Listeners>
                    </ext:TreePanel>
                </Items>
            </ext:Panel>
            <ext:TabPanel ID="ExampleTabs" runat="server" Region="Center" Margins="0 4 4 0" EnableTabScroll="true"
                MinTabWidth="85">
                <Items>
                    <ext:Panel ID="tabHome" runat="server" Title="主页" Icon="House">
                        <AutoLoad Mode="IFrame" Url="~/Notes.aspx" ShowMask="false" />
                    </ext:Panel>
                </Items>
                <Listeners>
                    <TabChange Fn="addToken" />
                </Listeners>
                <Plugins>
                    <ext:TabCloseMenu ID="TabCloseMenu1" runat="server" />
                </Plugins>
            </ext:TabPanel>
        </Items>
    </ext:Viewport>
    <ext:Window ID="winPassword" runat="server" Width="350" AutoHeight="true" Title="密码修改"
        Icon="Textfield" Closable="true" CloseAction="Hide" Padding="5" Resizable="false"
        Modal="true" Hidden="true" LabelWidth="125" Layout="Form">
        <Items>
            <ext:FormPanel ID="panelDetail" runat="server" LabelWidth="60" AutoWidth="true" Padding="5"
                Frame="true">
                <Items>
                    <ext:TextField ID="PasswordField" runat="server" FieldLabel="密码" InputType="Password"
                        Width="175">
                    </ext:TextField>
                    <ext:TextField ID="PasswordFieldVal" runat="server" Vtype="password" FieldLabel="确认密码"
                        InputType="Password" MsgTarget="Side" Width="175">
                        <CustomConfig>
                            <ext:ConfigItem Name="initialPassField" Value="#{PasswordField}" Mode="Value" />
                        </CustomConfig>
                    </ext:TextField>
                </Items>
            </ext:FormPanel>
        </Items>
        <Buttons>
            <ext:Button ID="btnSavePassword" runat="server" Text="保存" Icon="DatabaseStart">
                <DirectEvents>
                    <Click OnEvent="btnSavePassword_Click">
                        <EventMask Msg="密码修改中..." ShowMask="true" Target="Parent" />
                    </Click>
                </DirectEvents>
            </ext:Button>
            <ext:Button ID="btnClose" runat="server" Text="关闭" Icon="DatabaseStop">
                <Listeners>
                    <Click Handler="#{winPassword}.hide();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
</body>
</html>
